<?php

/**
 * Idee filter form base class.
 *
 * @package    sf_sandbox
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseIdeeFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'nom'           => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'description'   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'users_id'      => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'date_creation' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'etat'          => new sfWidgetFormChoice(array('choices' => array('' => '', 'disable' => 'disable', 'valide' => 'valide'))),
    ));

    $this->setValidators(array(
      'nom'           => new sfValidatorPass(array('required' => false)),
      'description'   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDateTime(array('required' => false)))),
      'users_id'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'date_creation' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'etat'          => new sfValidatorChoice(array('required' => false, 'choices' => array('disable' => 'disable', 'valide' => 'valide'))),
    ));

    $this->widgetSchema->setNameFormat('idee_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Idee';
  }

  public function getFields()
  {
    return array(
      'id'            => 'Number',
      'nom'           => 'Text',
      'description'   => 'Date',
      'users_id'      => 'Number',
      'date_creation' => 'Date',
      'etat'          => 'Enum',
    );
  }
}
